package mo.leetcode_top;

public class L171 {

    public int titleToNumber(String columnTitle) {

        int res = 0;
        for (int i = 0; i < columnTitle.length(); i++) {
            res = res * 26 + (columnTitle.charAt(i) - 'A' + 1);
        }

        return res;
    }

    public static void main(String[] args) {
        L171 test = new L171();
        System.out.println(test.titleToNumber("ZY"));
    }

}
